/********************************************************************************
 *      Copyright:  (C) 2023 LN
 *                  All rights reserved.
 *
 *       Filename:  pack_data.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(2023年07月03日)
 *         Author:  Li Haipeng <NULL>
 *      ChangeLog:  1, Release initial version on "2023年07月03日 09时52分27秒"
 *                 
 ********************************************************************************/
#ifndef _MQTT_CONFIG_H_
#define _MQTT_CONFIG_H_

#define BUF_SIZE 128
#define PUB 1
#define SUB 2

typedef struct data_mqtt
{
	char    hostname[BUF_SIZE] ;
	int     port ;
	char    username[BUF_SIZE] ;
	char    passwd[BUF_SIZE] ;
	char    clientid[BUF_SIZE] ;
	char    topic[BUF_SIZE] ;
	int     Qos;
 
	char    updata[BUF_SIZE] ;
	char    state[BUF_SIZE] ;
	char    reported[BUF_SIZE] ;
	char    method[BUF_SIZE] ;
	char    jsonid[BUF_SIZE] ;
	char    identifier[BUF_SIZE] ;
	char    version[BUF_SIZE] ;
}data_mqtt;
 
int get_mqttdata(char *ini_path,data_mqtt *mqtt,int option);
int pack_data(data_mqtt *mqtt,char *msg,int size,int option);

#endif

